/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.utp.semestral.sql;

import java.sql.Connection;
import java.sql.DriverManager;



/**
 *
 * @author JOSE
 */
public class Conexion {
    
private String bd = "inventario";
private String url = "jdbc:mysql://localhost/"+bd;
private String user = "root";
private String pass = "DEADMAN";

    public Conexion() {
    }
   
    public Connection conexionDB(){
    
    
    Connection link = null;
    
    try{
    
    Class.forName("org.gjt.mm.mysql.Driver");
    link = DriverManager.getConnection(this.url, this.user, this.pass);
    
    System.out.println("Connecion establecida");
    }
    
    catch(Exception e){
       System.out.println("Error al conectar a la bd");
    }
    System.out.println(link);
        return link;
        
    
    }
    
}
